const { defineConfig } = require('@vue/cli-service');
module.exports = defineConfig({
  publicPath: process.env.NODE_ENV === 'production' ? './' : '/',
  devServer: {
    proxy: {
      '/biddingProxy': {
        // target: 'https://cfcpn.seeyii.com/',
        target: 'http://47.93.55.7:8599/',
        changeOrigin: true,
        secure: true
      }
    },
    setupMiddlewares:
      process.env.VUE_APP_MOCK !== 'none'
        ? require('./mock/mock-server')
        : (middlewares, devServer) => {
            if (!devServer) {
              throw new Error('webpack-dev-server is not defined');
            }
            return middlewares;
          }
  },
  configureWebpack: config => {
    config.module.rules.push({
      test: /\.md$/,
      use: [
        { loader: 'html-loader' },
        { loader: 'markdown-loader', options: {} }
      ]
    });
  },
  transpileDependencies: true
});
